package com.jt.www.domain.enums.pc;

/**
 * 协议状态
 *
 * @author admin_ltf
 * @create 2019-05-18 11:42
 */
public enum AgreeStatusEnum {
    DEFAULT("无协议", 0),
    YES("生效", 1),
    NO("失效", 2);

    private String msg;
    private int code;

    AgreeStatusEnum(String msg, int code) {
        this.msg = msg;
        this.code = code;
    }

    public static String getMsgByCode(int code) {
        for (AgreeStatusEnum agreeStatusEnum : AgreeStatusEnum.values()) {
            if (agreeStatusEnum.code == code) {
                return agreeStatusEnum.msg;
            }
        }
        return "";
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
